export default {
  state: {
    userInfo: null,
  },
  getters: {
    getUserInfo(state) {
      const data =
        state.userInfo || JSON.parse(sessionStorage.getItem("userInfo"));
      return data;
    },
  },
  mutations: {
    setUserInfo(state, params) {
      state.userInfo = params;
    },
  },
  actions: {
    handleLogin({ commit }, params) {
      return new Promise((resolve, reject) => {
        // login(params)
        //   .then((res) => {})
        //   .catch((err) => {
        //     reject(err);
        //   });
      });
    },
  },
};
